<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>注册</title>
		<script src="js/jquery-3.6.0.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" href="css/reset.css" type="text/css" />
		<link rel="stylesheet" href="css/utrls.css" type="text/css" />
		<link rel="stylesheet" href="css/register.css" type="text/css" />
	</head>
	<body>
		<div class="main">
			<div id="registerForm" class="form">
				<h2>用户注册</h2>
				<input type="text" class="user" placeholder="账号" id="register_user" required><br>
				<input type="password" class="password" placeholder="密码" id="register_password" required><br>
				<button type="button" onclick="register(event)">注册</button> <br>
				<a href="login.html">登录</a><br>
				<div class="checkbox">
					<input type="checkbox" class="radio" name="agreement" id="agree" required />
					<label for="agree" class="checkbox-label">
						<span class="custom-checkbox checkmark"></span>
						同意《服务条款》《隐私政策》《儿童隐私政策》
					</label>
				</div>
			</div>
		</div>
	</body>
	<script>
		function register(event) {
			event.preventDefault(); // 阻止默认提交行为
			var user = $('#register_user').val();
			var password = $('#register_password').val();
			if ($('#agree').is(':checked')) {
				alert("注册成功！");
				window.location.href = 'login.html';
			} else {
				alert('请先同意服务条款！');
				$('#captcha-answer').val('');
				$('#login_user').val('')
				$('#login_password').val('')
			}
		}
	</script>
</html>